package com.itbaizhan.zookeeper.rmi.server;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

public class RmiServer {
    public static void main(String[] args) throws Exception {
        System.out.println("rmi server running...");
        int port = 1099;
        // 定义url
        String url = "rmi://localhost:1099/com.itbaizhan.zookeeper.rmi.server.HelloServiceImpl";
        // 注册服务
        LocateRegistry.createRegistry(port);
        Naming.rebind(url,new HelloServiceImpl());
    }
}
